<%@ Page Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true" CodeFile="AddAccount.aspx.cs" Inherits="Pages_Admin_AddAccount" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:Label ID="Label1" runat="server" Font-Bold="True" Text="Add Account" CssClass="header"></asp:Label><br />
    <br />
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" />
    <table border="1" class="table01" style="width: 562px">
        <tr>
            <td style="width: 8px; height: 20px">
                <strong>Username</strong></td>
            <td style="height: 20px; width: 461px;">
                <asp:TextBox ID="txtUserName" runat="server" MaxLength="12" onkeyup="userNameChecker(this.value);"></asp:TextBox>
                <asp:RequiredFieldValidator ID="reqUserName" runat="server" ControlToValidate="txtUserName"
                    ErrorMessage="Username cannot be blank">*</asp:RequiredFieldValidator>
                <span id="spanAlert"></span>
                <asp:RegularExpressionValidator ID="regUserName" runat="server" ControlToValidate="txtUserName"
                    ErrorMessage="Invalid Username (must be 6-12 characters)" ValidationExpression="^[\d\w]{6,12}$">*</asp:RegularExpressionValidator>
                
                </td>

        </tr>
        <tr>
            <td style="width: 8px;">
                <strong>Password</strong></td>
            <td style="width: 461px;">
                <asp:TextBox ID="txtPassword" runat="server" MaxLength="12" TextMode="Password" Width="149px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="reqPassword" runat="server" ControlToValidate="txtPassword"
                    ErrorMessage="Password cannot be blank">*</asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="regPassword" runat="server" ControlToValidate="txtPassword"
                    ErrorMessage="Invalid Password (must be 6-12 characters)" ValidationExpression="^[\d\w]{6,12}$"></asp:RegularExpressionValidator>
                </td>
        </tr>
        <tr>
            <td style="width: 8px">
                <strong>FullName</strong></td>
            <td style="width: 461px">
                <asp:TextBox ID="txtFullName" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="reqFullName" runat="server" ControlToValidate="txtFullName"
                    ErrorMessage="FullName cannot be blank">*</asp:RequiredFieldValidator></td>
        </tr>
        <tr>
            <td style="width: 8px">
                <strong>Address</strong></td>
            <td style="width: 461px">
                <asp:TextBox ID="txtAddress" runat="server" MaxLength="400" TextMode="MultiLine"></asp:TextBox>
                <asp:RequiredFieldValidator ID="reqAddress" runat="server" ControlToValidate="txtAddress"
                    ErrorMessage="Address cannot be blank">*</asp:RequiredFieldValidator></td>
        </tr>
        <tr>
            <td style="width: 8px">
                <strong>Email</strong></td>
            <td style="width: 461px">
                <asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>&nbsp;
                <asp:RegularExpressionValidator ID="regEmail" runat="server" ControlToValidate="txtEmail"
                    ErrorMessage="Invalid Email" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator></td>
        </tr>
        <tr>
            <td style="width: 8px">
                <strong>PhoneNumber</strong></td>
            <td style="width: 461px">
                <asp:TextBox ID="txtPhoneNumber" runat="server"></asp:TextBox>
                <asp:RegularExpressionValidator ID="regPhone" runat="server" ControlToValidate="txtPhoneNumber"
                    ErrorMessage="Invalid PhoneNumber" ValidationExpression="^[0-9]{9,20}$">*</asp:RegularExpressionValidator></td>
        </tr>
        <tr>
            <td style="width: 8px">
                <strong>Branch</strong></td>
            <td style="width: 461px">
                <asp:DropDownList ID="ddlBranch" runat="server" DataSourceID="ObjectDataSource1"
                    DataTextField="BranchName" DataValueField="PinCode">
                </asp:DropDownList>
                <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="ListBranch"
                    TypeName="DALBranch"></asp:ObjectDataSource>
            </td>
        </tr>
        <tr>
            <td style="width: 8px">
                <strong>Role</strong></td>
            <td style="width: 461px">
                <asp:DropDownList ID="ddlRole" runat="server">
                    <asp:ListItem Selected="True">Employee</asp:ListItem>
                    <asp:ListItem>Admin</asp:ListItem>
                </asp:DropDownList></td>
        </tr>
        <tr>
            <td style="width: 8px">
            </td>
            <td style="width: 461px">
                <asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" />
                &nbsp; &nbsp;
                <input type="reset" name="btnReset" value="Reset" />
                </td>
        </tr>
        <tr>
            <td style="width: 8px; height: 61px">
            </td>
            <td style="width: 461px; height: 61px">
                <asp:ValidationSummary ID="ValidationSummary1" runat="server" />
                <br />
                <asp:Label ID="lblMessage" runat="server"></asp:Label></td>
        </tr>
    </table>
    
    <script type="text/javascript" src="../../Scripts/checkusername.js"></script>
</asp:Content>

